//OrbModel.h
//Created 20/04/14
//Created By Daniel Bowler
//
//Represents the orb collectable within roo's world.

#pragma once

#include "AbstractAdvancedModel.h"

//Which shader to use for the orb?
//
//If uncommented, use reflection shader. Else, use semi-transparent orb.
//#define ORB_USE_REFLECTION_SHADER  

//Forward declare the effect we will be using
class ReflectRefractFX;

class OrbModel : public AbstractAdvancedModel
{
public:
	//Constructor/Destrouctor
	OrbModel(ID3D11Device* device);
	~OrbModel();

	//Draw - called by grpahics interface.
	void Render(bool isZPrePass, bool isOpaquePass, bool isShadowPass, //Flags telling us what pass it is. 
		VirtualCamera* playerCamera,										   //Player camera - passed from GraphicsInterface
		DirecLightShadowMapData* shadowMap,									   //Single shadow map - passed from GraphicsInterface. 
		SSAOData* ssaoMap,												       //SSAO Map.
		ID3D11ShaderResourceView* envMap,									   //Environment map. 
		ID3D11ShaderResourceView* llb,                                         //Light list buffer - gloabl set of lights. 
		ID3D11ShaderResourceView* llibO, ID3D11ShaderResourceView* llsebO,     //Opaque Tile Based Forward buffers. 
		ID3D11ShaderResourceView* llibT, ID3D11ShaderResourceView* llsebT,     //Transparant pass. 
		DirectionalLight* dLightArr, unsigned dLightCount,					   //Directional lights and light count. 
		XMFLOAT3 &hemiColDown, XMFLOAT3 &hemiColRange,					       //Hemispherical ambient lighting data. 
		CXMMATRIX &view, CXMMATRIX &proj,									   //Cameras view/proj or the shadow maps view/proj depending on the pass. 
		ID3D11DeviceContext* context);									       //Context used to draw 

private:
	//Effect we will be using. 
	ReflectRefractFX* reflectRefractEffect;

	//Buffers
	ID3D11Buffer* vb;
	ID3D11Buffer* ib;

	//Num indicies to draw
	unsigned indexCount;

	//Txture Map
	ID3D11ShaderResourceView* textureMap;

	//Material
	Material material;

private:
	void LoadGeometryData(ID3D11Device* device);
};